import axios from 'axios'
const request = axios.create({
    timeout: 5000,
    method: 'get',
    baseURL:import.meta.env.VITE_BASE_URL
})
request.interceptors.request.use(req => {
    return req
}, err => {
    return Promise.reject(err)
})
request.interceptors.response.use(res => {
    if (res.status === 200) {
        return res.data
    } else {
        res.errMsg = '数据响应失败'
        return Promise.reject(res)
    }
}, err => {
    return Promise.reject(err)
})
export default request